package com.example.web.controller;


import com.example.common.Interface.payment.entity.dto.ChargeReqDTO;
import com.example.common.Interface.payment.entity.dto.ChargeRespDTO;
import com.example.common.Interface.payment.service.PaymentService;
import com.example.common.response.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/payment")
@Slf4j
public class PaymentController {
    @DubboReference(check = false)
    private PaymentService paymentService;

    @PostMapping("/charge")
    public ResponseResult<ChargeRespDTO> charge(@RequestBody ChargeReqDTO chargeReq){
        return ResponseResult.success(paymentService.Charge(chargeReq));
    }

}
